package com.smc.common.exception;

import com.fasterxml.jackson.annotation.JsonInclude;

/**
 * 异常消息对象
 *
 * @author zouqinghua
 * @date 2016年8月31日 下午8:01:16
 */
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ExceptionResult {

  private String msg;

  private ExceptionResult(Builder builder) {
    setMsg(builder.msg);
  }

  public static Builder newBuilder() {
    return new Builder();
  }

  public String getMsg() {
    return msg;
  }

  public void setMsg(String msg) {
    this.msg = msg;
  }

  public static final class Builder {
    private String msg;

    private Builder() {}

    public Builder msg(String val) {
      msg = val;
      return this;
    }

    public ExceptionResult build() {
      return new ExceptionResult(this);
    }
  }
}
